# eric7.MicroPython.WifiDialogs.WifiController

Module implementing the WiFi related functionality.

### Global Attributes

None

### Classes

WifiController | Class implementing the WiFi related functionality.

### Functions

None

## WifiController

Class implementing the WiFi related functionality.

### Derived from

QObject

### Class Attributes

None

### Class Methods

None

### Methods

WifiController | Constructor
__checkInternet | Private slot to check the availability of an internet connection.
__connectWifi | Private slot to connect the current device to a WiFi network.
__deactivateInterface | Private method to deactivate a given WiFi interface of the connected device.
__disableWebrepl | Private slot to disable the WebREPL server of the device.
__disconnectWifi | Private slot to disconnect the current device from the WiFi network.
__disconnectedFromDevice | Private slot handling disconnection from a device.
__enableWebrepl | Private slot to enable the WebREPL server of the device.
__removeCredentials | Private slot to remove the saved WiFi credentials from the connected device.
__scanNetwork | Private slot to scan for visible WiFi networks.
__setNetworkTime | Private slot to synchronize the device clock to network time.
__showConnectedClients | Private slot to show a list of WiFi clients connected to the Access Point interface.
__showWifiStatus | Private slot to show a dialog with the WiFi status of the current device.
__startAccessPoint | Private slot to start the Access Point interface of the connected device.
__startAccessPointIP | Private slot to start the Access Point interface of the connected device with given IP parameters.
__stopAccessPoint | Private slot to stop the Access Point interface of the connected device.
__writeCredentials | Private slot to save the WiFi login credentials to the connected device.
createMenu | Public method to create the WiFi submenu.

### Static Methods

None

#### WifiController (Constructor)

WifiController(microPython, parent=None)

Constructor

microPython (MicroPythonWidget)
  reference to the MicroPython widget
parent (QObject (optional))
  reference to the parent object (defaults to None)

#### WifiController.__checkInternet

__checkInternet()

Private slot to check the availability of an internet connection.

#### WifiController.__connectWifi

__connectWifi()

Private slot to connect the current device to a WiFi network.

#### WifiController.__deactivateInterface

__deactivateInterface(interface)

Private method to deactivate a given WiFi interface of the connected device.

interface (str)
  designation of the interface to be deactivated (one of 'AP' or 'STA')

#### WifiController.__disableWebrepl

__disableWebrepl()

Private slot to disable the WebREPL server of the device.

This will not remove the 'webrepl_cfg.py' file. It will just modify the boot script.

#### WifiController.__disconnectWifi

__disconnectWifi()

Private slot to disconnect the current device from the WiFi network.

#### WifiController.__disconnectedFromDevice

__disconnectedFromDevice()

Private slot handling disconnection from a device.

#### WifiController.__enableWebrepl

__enableWebrepl()

Private slot to enable the WebREPL server of the device.

This will also modify the boot script.

#### WifiController.__removeCredentials

__removeCredentials()

Private slot to remove the saved WiFi credentials from the connected device.

This will not remove the auto-connect part of the boot script. This needs to be done manually if desired.

#### WifiController.__scanNetwork

__scanNetwork()

Private slot to scan for visible WiFi networks.

#### WifiController.__setNetworkTime

__setNetworkTime()

Private slot to synchronize the device clock to network time.

#### WifiController.__showConnectedClients

__showConnectedClients()

Private slot to show a list of WiFi clients connected to the Access Point interface.

#### WifiController.__showWifiStatus

__showWifiStatus()

Private slot to show a dialog with the WiFi status of the current device.

#### WifiController.__startAccessPoint

__startAccessPoint(withIP=False)

Private slot to start the Access Point interface of the connected device.

withIP (bool)
  flag indicating to start the access point with an IP configuration

#### WifiController.__startAccessPointIP

__startAccessPointIP()

Private slot to start the Access Point interface of the connected device with given IP parameters.

#### WifiController.__stopAccessPoint

__stopAccessPoint()

Private slot to stop the Access Point interface of the connected device.

#### WifiController.__writeCredentials

__writeCredentials()

Private slot to save the WiFi login credentials to the connected device.

This will also modify the boot script to perform an automatic WiFi connection.

#### WifiController.createMenu

createMenu(menu)

Public method to create the WiFi submenu.

menu (QMenu)
  reference to the parent menu

Return:
  reference to the created menu

Return Type:
  QMenu

Up